import request from '@/utils/request.js';

// workorder config
// 分类
export function workorderGetCategoryService() {
    return request.get('/workorder/category');
}
// 分类流程
export function workorderSetFlowService(categoryId, flow) {
    return request.post('/workorder/category/flow', { categoryId, flow });
}
// 分类职责
export function workorderGetCategoryDutyService(categoryId) {
    return request.get('/workorder/category/duty/' + categoryId);
}
export function workorderSetDutyService(categoryId, duty) {
    return request.put('/workorder/category/duty/' + categoryId, duty);
}
// 分类状态
export function workorderGetStatusService() {
    return request.get('/workorder/status');
}

// workorder manage
export function workorderGetService(search, currentPage, pageSize) {
    return request.get('/workorder', { params: { search, currentPage, pageSize } });
}

export function workordeGetProcessInfoService(workorderId) {
    return request.get('/workorder/handleInfo/' + workorderId);
}

export function workorderSwitchCloseStatusService(workOrderId) {
    return request.put('/workorder/switchCloseStatus/' + workOrderId);
}